<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"  %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>观众登记</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<link rel="stylesheet" type="text/css" href="css/style.css"/>
	
	<script type="text/javascript" src="JS/jquery-1.7.2.js"></script>
	<script type="text/javascript" src="JS/common.js"></script>
	
	<style type="text/css">
		*{
		 	margin:0px;
			font-size: 12px;	
		 }
		  .errordiv
		 {
		 	border:2px solid #FF3030;
		 	background-color:#FF8C00;
		 	width:200px;
		 	height:25px
		 }
		 .textcss
		 {
		 	/*width:300px;
		 	border-color: #BFE05D;
		 	height: 25px;
		 	border-style: solid;
		 	height:20px;
			color:#135709;
			border:1px solid #73bce6;
			background-color:#ebfaff;*/
		 	
		 }
		 .submitcss
		 {
		 	font-weight: bold;
		 }
		 .errortextcss
		 {
		 	width:300px;
		 	border-color: red;
		 }
		 .tabletrcss
		 {
		 	height:30px;
		 }
	</style>
	<SCRIPT type="text/javascript">
	//全局变量，区别当前的事件是失去焦点还是点击按钮提交，提交较验证时获取焦点，否则不获取焦点
	var submitFlag = false;
	var provinceCityArr = Array();
	var checkVal = Array();
	for(var i=0;i<10;i++){
		checkVal[i] = false;
	}

	//改变国家/地区的同时，改变电话和传真的地区号
	function country_onchange(value,text) {
		var provinces = document.getElementById("audience_province");
		var citys = document.getElementById("audience_city");
		var cityText = document.getElementById("cityText");
		$("#audience_tel1").val(value);
		$("#audience_fax1").val(value);
		$("#audience_nation").val(text);
		if(value=="86"){
			provinces.style.display = '';
			citys.style.display = '';
			cityText.style.display = 'none';
			//加载省份
			getProvinceCity();
		}else{
			provinces.style.display = 'none';
			citys.style.display = 'none';
			cityText.style.display = '';
		}
	}

	//加省份和城市的数据
	function getProvinceCity(){
		$.ajax({  
				url:'${pageContext.request.contextPath}/provinceCityAction.action',  
				type:'POST',  
				data:"{}",  
				dataType:'json',
				timeout: 100000,
				async:true,               
				error: function(a){                     
					alert('获取省份城市，出错了');                 
				},   
				success:function (data) {
					provinceCityArr = data.provinceCityList;
					//加载省份
					var provinces = document.getElementById("audience_province");
					for(var i=0;i<provinceCityArr.length;i++){
						var provinceOb = provinceCityArr[i];
						if(provinceOb.pid == '0'){
							var objOption = document.createElement("OPTION");
						    objOption.value = provinceOb.id;
						    objOption.text = provinceOb.text;
						    provinces.add(objOption);
						    //默认选择
						    if(provinceOb.text == '北京'){
						    	provinces.options[provinces.options.length-1].selected = 'selected';
						    	loadCity();
							}
						}
					}
				}
		});
	}

	//加载城市
	function loadCity(){
		var currPro = document.getElementById("audience_province").value;
		var citys = document.getElementById("audience_city");
		citys.options.length = 0;
		for(var i=0;i<provinceCityArr.length;i++){
			var cityOb = provinceCityArr[i];
			if(cityOb.pid == currPro){
				var objOption = document.createElement("OPTION");
			    objOption.value = cityOb.text;
			    objOption.text = cityOb.text;
			    
			    citys.add(objOption);
			    citys.options[0].selected = 'selected';
			}
		}
	}
		$(function(){
			//加载省份
			getProvinceCity();
			//$("#audience_name").focus();
			$('form :input').blur(function(){
				var $parent = $(this).parent();
				$parent.find(".formtips").remove();//删除之前的错误提醒？？？
				//验证姓名
				if($(this).is('#audience_name')){
					if(this.value==""){
						var nameError = "姓名不能为空";
						$parent.append('<span class="formtips onError"><font color="red">'+nameError+'</font></span>');
						if(submitFlag == true){
							$(this).focus();
							//校验出错，改为失去焦点校验
							submitFlag = false;
						}
					}else if(this.value.length > 100){
						var nameError = "请输入少于100位的姓名";
						$parent.append('<span class="formtips onError"><font color="red">'+nameError+'</font></span>');
						if(submitFlag == true){
							$(this).focus();
							//校验出错，改为失去焦点校验
							submitFlag = false;
						}
					}
				}
				//验证公司名称
				if($(this).is('#audience_company')){
					if(this.value==""){
						var companyError = "公司名称不能为空";
						$parent.append('<span class="formtips onError"><font color="red">'+companyError+'</font></span>');
						if(submitFlag == true){
							$(this).focus();
							//校验出错，改为失去焦点校验
							submitFlag = false;
						}
					}else if(this.value.length > 100){
						var companyError = "请输入少于100位的公司名称";
						$parent.append('<span class="formtips onError"><font color="red">'+companyError+'</font></span>');
						if(submitFlag == true){
							$(this).focus();
							//校验出错，改为失去焦点校验
							submitFlag = false;
						}
					}
				}
				//职位
				if($(this).is('#audience_position')){
					if(this.value==""){
						var positionError = "职位不能为空";
						$parent.append('<span class="formtips onError"><font color="red">'+positionError+'</font></span>');
						if(submitFlag == true){
							$(this).focus();
							//校验出错，改为失去焦点校验
							submitFlag = false;
						}
					}else if(this.value.length > 100){
						var positionError = "请输入少于100位的职位";
						$parent.append('<span class="formtips onError"><font color="red">'+positionError+'</font></span>');
						if(submitFlag == true){
							$(this).focus();
							//校验出错，改为失去焦点校验
							submitFlag = false;
						}
					}
				}
				//地址1
				if($(this).is('#audience_address1')){
					if(this.value==""){
						var address1Error = "地址不能为空";
						$parent.append('<span class="formtips onError"><font color="red">'+address1Error+'</font></span>');
						if(submitFlag == true){
							$(this).focus();
							//校验出错，改为失去焦点校验
							submitFlag = false;
						}
					}else if(this.value.length > 110){
						var address1Error = "请输入少于110位的地址";
						$parent.append('<span class="formtips onError"><font color="red">'+address1Error+'</font></span>');
						if(submitFlag == true){
							$(this).focus();
							//校验出错，改为失去焦点校验
							submitFlag = false;
						}
					}
				}
				//国家为外国时城市不能为空
				var cityText = document.getElementById("cityText");
				if(cityText.style.display == ""){
					if($(this).is('#cityText')){
						if(this.value==""){
							var cityError = "城市不能为空";
							$parent.append('<span class="formtips onError"><font color="red">'+cityError+'</font></span>');
							if(submitFlag == true){
								$(this).focus();
								//校验出错，改为失去焦点校验
								submitFlag = false;
							}
						}
					}
				}
				//邮编
				if($(this).is('#audience_postcode')){
					if(this.value==""){
						var postcodeError = "邮编不能为空";
						$parent.append('<span class="formtips onError"><font color="red">'+postcodeError+'</font></span>');
						if(submitFlag == true){
							$(this).focus();
							//校验出错，改为失去焦点校验
							submitFlag = false;
						}
					}else if(this.value.length > 100){
						var postcodeError = "请输入少于100位的邮编";
						$parent.append('<span class="formtips onError"><font color="red">'+postcodeError+'</font></span>');
						if(submitFlag == true){
							$(this).focus();
							//校验出错，改为失去焦点校验
							submitFlag = false;
						}
					}
				}
				var reg = /^[+\d]{1,4}-[\d]{2,4}-[\S]{3,30}$/;
				//电话
				if($(this).is('#audience_tel3')){
					//alert(11);
					var tel = $("#audience_tel1").val() + "-" + $("#audience_tel2").val() + "-" + $("#audience_tel3").val();
					if (!reg.test(tel)) {
						var telError = "请输入正确的电话号码";
						$parent.append('<span class="formtips onError"><font color="red">'+telError+'</font></span>');
						if(submitFlag == true){
							$(this).focus();
							//校验出错，改为失去焦点校验
							submitFlag = false;
						}
					}
				}
				//传真
				if($(this).is('#audience_fax3')){
					var fax = $("#audience_fax1").val() + "-" + $("#audience_fax2").val() + "-" + $("#audience_fax3").val();
					if (!reg.test(fax)) {
						var faxError = "请输入正确的传真";
						$parent.append('<span class="formtips onError"><font color="red">'+faxError+'</font></span>');
						if(submitFlag == true){
							$(this).focus();
							//校验出错，改为失去焦点校验
							submitFlag = false;
						}
					}
				}
				//手机
				if($(this).is('#audience_mobile')){
					var regs =/^(1[3,5,8,7]{1}[\d]{9})|(((400)-(\d{3})-(\d{4}))|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{3,7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)$/;
					var mobile = $("#audience_mobile").val();
					//alert(mobile);
					if (!regs.test(mobile)) {
						var mobileError = "请输入正确的手机号";
						$parent.append('<span class="formtips onError"><font color="red">'+mobileError+'</font></span>');
						if(submitFlag == true){
							$(this).focus();
							//校验出错，改为失去焦点校验
							submitFlag = false;
						}
					}else{
						$.ajax({  
							url:'${pageContext.request.contextPath}/preAudienceAction!validateAudienceIsExist.action',  
							type:'POST',  
							data:{name:'audience_mobile',value:mobile},  
							dataType:'json',
							timeout: 5000,
							async:true,               
							error: function(XmlHttpRequest, textStatus, errorThrown){             
								//alert(XmlHttpRequest.status);             
								if(XmlHttpRequest.status==200){                 
									var errorstr = XmlHttpRequest.responseText;                 
									alert(errorstr);             
									}                
							},   
							success:function (data,textStatus) { 
							    //alert(data.audienceList.length);
								if(data.audienceList.length > 0){
									var mobileError = "该手机号码已存在";
									$parent.append('<span class="formtips onError"><font color="red">'+mobileError+'</font></span>');
									if(submitFlag == true){
										$(this).focus();
										//校验出错，改为失去焦点校验
										submitFlag = false;
									}
								}
							}  
							});
					}
				}
				//邮箱
				if($(this).is('#audience_Email')){
					var regs =/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
					var email = $("#audience_Email").val();
					//alert(mobile);
					if (!regs.test(email)) {
						var emailError = "请输入正确的邮箱";
						$parent.append('<span class="formtips onError"><font color="red">'+emailError+'</font></span>');
						if(submitFlag == true){
							$(this).focus();
							//校验出错，改为失去焦点校验
							submitFlag = false;
						}
					}else{
						$.ajax({  
							url:'${pageContext.request.contextPath}/preAudienceAction!validateAudienceIsExist.action',  
							type:'POST',  
							data:{name:'audience_Email',value:email},  
							dataType:'json',
							timeout: 5000,
							async:true,               
							error: function(XmlHttpRequest, textStatus, errorThrown){             
								//alert(XmlHttpRequest.status);             
								if(XmlHttpRequest.status==200){                 
									var errorstr = XmlHttpRequest.responseText;                 
									alert(errorstr);             
									}                  
							},   
							success:function (data) { 
							   // alert(data.audienceList.length);
								if(data.audienceList.length > 0){
									var emailError = "该邮箱已存在";
									$parent.append('<span class="formtips onError"><font color="red">'+emailError+'</font></span>');
									if(submitFlag == true){
										$(this).focus();
										//校验出错，改为失去焦点校验
										submitFlag = false;
									}
								}
							}  
							});
					}
				}
				//验证邮箱
				if($(this).is('#audience_reEmail')){
					var email = $("#audience_Email").val();
					var reemail = $("#audience_reEmail").val();
					//alert(email + "----" + reemail);
					if (reemail != email) {
						var reemailError = "确认邮箱输入不一致";
						$parent.append('<span class="formtips onError"><font color="red">'+reemailError+'</font></span>');
						if(submitFlag == true){
							$(this).focus();
							//校验出错，改为失去焦点校验
							submitFlag = false;
						}
					}
				}
			});
		});

		//推荐好友
		function checkEmails(num) {
			var html = "";
			for (i=1;i<=parseInt(num);i++) {
				html += (i==1?"":"<br>") + i + ". <input type=text name='ToEmail" + i + "' id='ToEmail" + i + "' style='margin-bottom:3px' />";
			}
			$("#Emails").html(html);
		}

		//提交时判断输入是否合法
		function checkInput(){
			//提交校验
			submitFlag = true;
			
			$("form :input ").trigger('blur');
			var numError = $('form .onError').length;
			if(numError > 0){
				return false;
			}
			
			//校验调查问卷
			var i = 0;
			var checkSel = "[" ;
			var qtitleidarr = "";//所有大标题的id值
			//var html = "";
			for(var len=0;;){
				var qtitlename = $("#qtitle"+len).val();
				if(typeof(qtitlename) == "undefined"){
					//结束循环
					break;
				}else{
					qtitleidarr += qtitlename+","; 
					var inputtype = $(":input:[name="+qtitlename+"]").attr("type");
					checkSel += "{'qtitleid':'"+qtitlename+"','inputtype':'" + inputtype + "','qidstr':'";
					//alert("::::::"+$(":input:[name="+qtitlename+"]").attr("type"));
					//判断是复选框 还是单选
					if(inputtype == "checkbox"){
						//alert($('[name='+qtitlename+']:checkbox:checked').val());
						var checkboxval = $('[name='+qtitlename+']:checkbox:checked').attr("value");
						if(typeof(checkboxval) == "undefined"){
							$("#"+qtitlename).focus();
							$("#span_"+qtitlename).html("该项信息未选择");
							$("#span_"+qtitlename).css("color","red");
							return false;
						}
						$("#span_"+qtitlename).html("");
						$('[name='+qtitlename+']:checkbox:checked').each(function(){
							if($(this).val() == "-1"){
								var otherval = $("#"+qtitlename).val();
								if(otherval == ''){
									$("#"+qtitlename).focus();
									$("#span_"+qtitlename).html("其他信息未填写");
									$("#span_"+qtitlename).css("color","#FF0000");
									return false;
								}else{
									var indexOfCount = otherval.indexOf(',') + otherval.indexOf(':') + otherval.indexOf(';') + otherval.indexOf('\'') + otherval.indexOf('\"');
									if(indexOfCount > -5){
										$("#"+qtitlename).focus();
										$("#span_"+qtitlename).html("信息中不能包含英文的符号如, : ; \'\' \"\"等");
										$("#span_"+qtitlename).css("color","#FF0000");
										return false;
									}
								}
								$("#span_"+qtitlename).html("");
							}
							checkSel += $(this).val() + "*";
						});
					}else if(inputtype == "radio"){
						//$(":input:[name="+qtitlename+"]").val();
						var radioval = $(':input:[name='+qtitlename+']:checked').val();
						if(typeof(radioval) == "undefined"){
							$("#"+qtitlename).focus();
							$("#span_"+qtitlename).html("该项信息未选择");
							$("#span_"+qtitlename).css("color","red");
							//alert("问卷调查未填写完整");
							return false;
						}
						$("#span_"+qtitlename).html("");
						if(radioval == "-1"){
							var otherval = $("#"+qtitlename).val();
							if(otherval == ''){
								$("#"+qtitlename).focus();
								$("#span_"+qtitlename).html("其他信息未填写");
								$("#span_"+qtitlename).css("color","red");
								return false;
							}else{
								var indexOfCount = otherval.indexOf(',') + otherval.indexOf(':') + otherval.indexOf(';') + otherval.indexOf('\'') + otherval.indexOf('\"');
								alert(indexOfCount);
								if(indexOfCount > -5){
									$("#"+qtitlename).focus();
									$("#span_"+qtitlename).html("信息中不能包含英文的符号如, : ; \'\' \"\"等");
									$("#span_"+qtitlename).css("color","#FF0000");
									return false;
								}
							}
							$("#span_"+qtitlename).html("");
						}
						
						checkSel += radioval + "*";
					}
					//其他选项的文本框输入的值(如果为空，则不加)
					var otherval = $("#"+qtitlename).val();
					checkSel += "'";
					if(otherval != ''){
						checkSel += ",'otherval':'" + otherval + "'"; 
					}
					checkSel += "},";
					len++;
				}
			}
			checkSel += "]";
			var checkSelInfo = "{'qtitleidarr':'"+qtitleidarr+"','checksel':"+checkSel+"}"; 
			$("#questioninfo").attr("value",checkSelInfo);
			//推荐好友
			var count= $("#EmailCount").val();
			var s="";
			for(var j=1;j<=count;j++){
					s+=$("#ToEmail"+j).val()+"*";
				}
			$("#emails").attr("value",s);
			//电话
			var telStr = $("#audience_tel1").val() + "-" + $("#audience_tel2").val() + "-" + $("#audience_tel3").val();
			$("#audience_tel").attr("value",telStr);	
			//传真
			var faxStr = $("#audience_fax1").val() + "-" + $("#audience_fax2").val() + "-" + $("#audience_fax3").val();
			$("#audience_fax").attr("value",faxStr);
			//国家
			var currNationText = $("#nation").find("option:selected").text();
			$("#audience_nation").attr("value",currNationText);
			//省份
			var currProText = $("#audience_province").find("option:selected").text();
			$("#hAudience_province").attr("value",currProText);
			//城市
			var cityText = document.getElementById("cityText");
			if(cityText.style.display == ""){
				$("#hAudience_city").attr("value",cityText.value);
				$("#hAudience_province").attr("value","");
			}else{
				var currCityText = $("#audience_city").find("option:selected").text();
				$("#hAudience_city").attr("value",currCityText);
			}
			
			return true;
		}
		
		
	</SCRIPT>
  </head>
  
  <body>
   <center>
   <iframe src="header.jsp?source=${source }&imgPath=${showInfo.hearderImgPath}" marginheight="0" marginwidth="0" frameborder="0" scrolling="no" width="100%" height="235px"></iframe>
   <form action="${pageContext.request.contextPath}/audienceRegister.action?source=${source}" method="post"  onsubmit="return checkInput()">
   <table width="1000px"  border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
   		<tr>
   			<td colspan="2" style="padding-left: 200px" bgcolor="#FFFFFF" class="fontblack" >
   				<b style="font-size: 24px;">观众登记</b>>><img alt="" src="images/required.gif" />为必填项
   			</td>
   		</tr>
   		
		<tr >
			<td align="right" bgcolor="#FFFFFF" style="fontblack">
				姓名：<img alt="" src="images/required.gif" align="top"/>
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
				<input type="hidden" id="show_id" name="audience.show_id" value="${showInfo.id}"/>
				<input type="text" id="audience_name" name="audience.audience_name" value="" style="width:200px"/>
			</td>
		</tr>
		<tr >
			<td align="right" bgcolor="#FFFFFF" style="fontblack">
				性别：<img alt="" src="images/required.gif" align="top"/>
			</td>
			<td align="left" bgcolor="#FFFFFF" style="fontblack">
				<input type="radio" id="audience_sex" name="audience.audience_sex" class="textcss" value="0" checked="checked"/>先生
				<input type="radio" id="audience_sex" name="audience.audience_sex" value="1"/>女士
			</td>
		</tr>
		<tr class="tabletrcss">
			<td align="right" width="25%" bgcolor="#FFFFFF" style="fontblack">
				公司名称：<img alt="" src="images/required.gif" align="top"/>
			</td>
			<td align="left" bgcolor="#FFFFFF" style="fontblack">
				<input type="text" id="audience_company" name="audience.audience_company" class="textcss" style="width:300px"/>
			</td>
		</tr>
		<tr >
			<td align="right"  bgcolor="#FFFFFF" style="fontblack">
				部门：&nbsp;<!-- <img alt="" src="images/required.gif" align="top"/> -->
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
				<input type="text" id="audience_department" name="audience.audience_department" class="textcss"  style="width:200px"/>
			</td>
		</tr>
		<tr >
			<td align="right"  bgcolor="#FFFFFF" style="fontblack">
				职位：<img alt="" src="images/required.gif" align="top"/>
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
				<input type="text" id="audience_position" name="audience.audience_position" class="textcss" style="width:200px" />
			</td>
		</tr>
		<tr >
			<td align="right"  bgcolor="#FFFFFF" style="fontblack">
				地址1：<img alt="" src="images/required.gif" align="top"/>
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
			<input type="text" id="audience_address1" name="audience.audience_address1" class="textcss" style="width:300px"/>
			<div>您填写的地址是邮寄买家证的凭据，请再次确认您的邮寄地址。</div>
			</td>
		</tr>
		<tr >
			<td align="right"  bgcolor="#FFFFFF" style="fontblack">
				地址2：&nbsp;<!-- <img alt="" src="images/required.gif" align="top"/> --> 
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
				<input type="text" id="audience_address2" name="audience.audience_address2" class="textcss" style="width:300px"/>
			</td>
		</tr>
		<tr >
			<td align="right"  bgcolor="#FFFFFF" style="fontblack">
				国家/地区：<img alt="" src="images/required.gif" align="top"/>
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
				<input type="hidden" id="audience_nation" name="audience.audience_nation" class="textcss" style="width:200px" value="中国" /> 
				<select id="nation" name="nation" class="fontblack" onchange="javascript:country_onchange(this.options[this.selectedIndex].value, this.options[this.selectedIndex].text);">
          <option value="86" selected="selected">中国</option>
          <option value="852">中国香港</option>
          <option value="853">中国澳门</option>
          <option value="886">中国台湾</option>
          <option value="93">阿富汗</option>
          <option value="355">阿尔巴尼亚</option>
          <option value="213">阿尔及利亚</option>
          <option value="376">安道尔</option>
          <option value="244">安哥拉</option>
          <option value="1264">安圭拉岛英</option>
          <option value="54">阿根廷</option>
          <option value="374">亚美尼亚</option>
          <option value="297">阿鲁巴岛</option>
          <option value="247">阿森松(英)</option>
          <option value="61">澳大利亚</option>
          <option value="43">奥地利</option>
          <option value="994">阿塞拜疆</option>
          <option value="1242">巴哈马</option>
          <option value="973">巴林</option>
          <option value="880">孟加拉国</option>
          <option value="1246">巴巴多斯</option>
          <option value="375">白俄罗斯</option>
          <option value="32">比利时</option>
          <option value="501">伯利兹</option>
          <option value="229">贝宁</option>
          <option value="1441">百慕大群岛</option>
          <option value="975">不丹</option>
          <option value="591">玻利维亚</option>
          <option value="387">波黑</option>
          <option value="267">博茨瓦纳</option>
          <option value="55">巴西</option>
          <option value="673">文莱</option>
          <option value="359">保加利亚</option>
          <option value="226">布基纳法索</option>
          <option value="95">缅甸</option>
          <option value="257">布隆迪</option>
          <option value="855">柬埔寨</option>
          <option value="237">喀麦隆</option>
          <option value="10">加拿大</option>
          <option value="238">佛得角</option>
          <option value="1345">开曼群岛</option>
          <option value="236">中非</option>
          <option value="235">乍得</option>
          <option value="56">智利</option>
          <option value="57">哥伦比亚</option>
          <option value="269">科摩罗</option>
          <option value="242">刚果</option>
          <option value="682">科克群岛</option>
          <option value="506">哥斯达黎加</option>
          <option value="385">克罗地亚</option>
          <option value="53">古巴</option>
          <option value="357">塞浦路斯</option>
          <option value="420">捷克</option>
          <option value="45">丹麦</option>
          <option value="253">吉布提</option>
          <option value="1767">多米尼加</option>
          <option value="1809">多米尼加共和国</option>
          <option value="593">厄瓜多尔</option>
          <option value="20">埃及</option>
          <option value="503">萨尔瓦多</option>
          <option value="240">赤道几内亚</option>
          <option value="291">厄立特里亚</option>
          <option value="372">爱沙尼亚</option>
          <option value="251">埃塞俄比亚</option>
          <option value="500">福克兰群岛</option>
          <option value="679">斐济</option>
          <option value="358">芬兰</option>
          <option value="33">法国</option>
          <option value="594">法属圭亚那</option>
          <option value="241">加蓬</option>
          <option value="220">冈比亚</option>
          <option value="995">格鲁吉亚</option>
          <option value="49">德国</option>
          <option value="233">加纳</option>
          <option value="350">直布罗陀</option>
          <option value="30">希腊</option>
          <option value="299">格陵兰岛</option>
          <option value="1473">格林纳达</option>
          <option value="1671">关岛</option>
          <option value="502">危地马拉</option>
          <option value="224">几内亚</option>
          <option value="245">几内亚比绍</option>
          <option value="592">圭亚那</option>
          <option value="509">海地</option>
          <option value="504">洪都拉斯</option>
          <option value="36">匈牙利</option>
          <option value="354">冰岛</option>
          <option value="91">印度</option>
          <option value="62">印度尼西亚</option>
          <option value="98">伊朗</option>
          <option value="964">伊拉克</option>
          <option value="353">爱尔兰</option>
          <option value="972">以色列</option>
          <option value="39">意大利</option>
          <option value="225">科特迪瓦</option>
          <option value="1876">牙买加</option>
          <option value="81">日本</option>
          <option value="962">约旦</option>
          <option value="7">哈萨克斯坦</option>
          <option value="254">肯尼亚</option>
          <option value="686">基里巴斯</option>
          <option value="82">韩国</option>
          <option value="965">科威特</option>
          <option value="996">吉尔吉斯坦</option>
          <option value="856">老挝</option>
          <option value="371">拉脱维亚</option>
          <option value="961">黎巴嫩</option>
          <option value="266">莱索托</option>
          <option value="231">利比里亚</option>
          <option value="218">利比亚</option>
          <option value="423">列支敦士登</option>
          <option value="370">立陶宛</option>
          <option value="352">卢森保</option>
          <option value="389">马其顿</option>
          <option value="261">马达加斯加</option>
          <option value="265">马拉维</option>
          <option value="60">马来西亚</option>
          <option value="960">马尔代夫</option>
          <option value="223">马里</option>
          <option value="356">马耳他</option>
          <option value="670">马里亚纳群岛</option>
          <option value="692">马绍尔群岛</option>
          <option value="596">马提尼克</option>
          <option value="222">毛里塔尼亚</option>
          <option value="230">毛里求斯</option>
          <option value="269">马约特岛</option>
          <option value="52">墨西哥</option>
          <option value="373">摩尔多瓦</option>
          <option value="377">摩纳哥</option>
          <option value="976">蒙古</option>
          <option value="1664">蒙特塞拉特岛</option>
          <option value="212">摩洛哥</option>
          <option value="258">莫桑比克</option>
          <option value="264">纳米比亚</option>
          <option value="674">瑙鲁</option>
          <option value="977">尼泊尔</option>
          <option value="31">荷兰</option>
          <option value="64">新西兰</option>
          <option value="505">尼加拉瓜</option>
          <option value="227">尼日尔</option>
          <option value="234">尼日利亚</option>
          <option value="683">纽埃岛(新)</option>
          <option value="672">诺福克岛</option>
          <option value="850">朝鲜</option>
          <option value="47">挪威</option>
          <option value="968">阿曼</option>
          <option value="92">巴基斯坦</option>
          <option value="507">巴拿马</option>
          <option value="675">巴布亚新几内亚</option>
          <option value="595">巴拉圭</option>
          <option value="51">秘鲁</option>
          <option value="63">菲律宾</option>
          <option value="48">波兰</option>
          <option value="351">葡萄牙</option>
          <option value="1787">波多黎各</option>
          <option value="974">卡塔尔</option>
          <option value="262">留尼汪岛</option>
          <option value="40">罗马尼亚</option>
          <option value="7">俄罗斯</option>
          <option value="250">卢旺达</option>
          <option value="685">萨摩亚</option>
          <option value="378">圣马力诺</option>
          <option value="966">沙特阿拉伯</option>
          <option value="221">塞内加尔</option>
          <option value="248">塞舌尔</option>
          <option value="232">塞拉利昂</option>
          <option value="65">新加坡</option>
          <option value="421">斯洛伐克</option>
          <option value="386">斯洛文尼亚</option>
          <option value="677">所罗门群岛</option>
          <option value="252">索马里</option>
          <option value="27">南非</option>
          <option value="34">西班牙</option>
          <option value="94">斯里兰卡</option>
          <option value="290">圣赫勒拿</option>
          <option value="1758">圣卢西亚</option>
          <option value="249">苏丹</option>
          <option value="597">苏里南</option>
          <option value="268">斯威士兰</option>
          <option value="46">瑞典</option>
          <option value="41">瑞士</option>
          <option value="963">叙利亚</option>
          <option value="255">坦桑尼亚</option>
          <option value="66">泰国</option>
          <option value="228">多哥</option>
          <option value="690">托克劳群岛(新)</option>
          <option value="676">汤加</option>
          <option value="216">突尼斯</option>
          <option value="90">土耳其</option>
          <option value="993">土库曼斯坦</option>
          <option value="688">图瓦卢</option>
          <option value="971">阿联酋</option>
          <option value="256">乌干达</option>
          <option value="380">乌克兰</option>
          <option value="44">英国</option>
          <option value="1">美国</option>
          <option value="598">乌拉圭</option>
          <option value="998">乌兹别克斯坦</option>
          <option value="678">瓦努阿图</option>
          <option value="379">梵蒂冈</option>
          <option value="58">委内瑞拉</option>
          <option value="84">越南</option>
          <option value="1808">威克岛(美)</option>
          <option value="967">也门</option>
          <option value="381">南斯拉夫</option>
          <option value="243">扎伊尔</option>
          <option value="260">赞比亚</option>
          <option value="263">津巴布韦</option>
                        </select>
				
			</td>
		</tr>
		<tr >
			<td align="right"  bgcolor="#FFFFFF" style="fontblack" height="30px">
				省份：<img alt="" src="images/required.gif" align="top"/>
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
				<input type="hidden" id="hAudience_province" name="audience.audience_province"/>
				 <select id="audience_province" style="width:150px;" onchange="loadCity();">
				 </select>
			</td>
		</tr>
		<tr >
			<td align="right"  bgcolor="#FFFFFF" style="fontblack" height="30px">
				城市：<img alt="" src="images/required.gif" align="top"/>
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
				<input type="hidden" id="hAudience_city" name="audience.audience_city"/>
				<select id="audience_city" style="width:150px;">
				 </select>
				<input type="text" id="cityText" name="cityText" style="display:none;"/>
			</td>
		</tr>
		
		<tr >
			<td align="right"  bgcolor="#FFFFFF" style="fontblack">
				邮编：<img alt="" src="images/required.gif" align="top"/>
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
				<input type="text" id="audience_postcode" name="audience.audience_postcode" class="textcss" style="width:200px"/>
			</td>
		</tr>
		<tr >
			<td align="right"  bgcolor="#FFFFFF" style="fontblack">
				电话：<img alt="" src="images/required.gif" align="top"/>
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
			  <input name="audience_tel1" type="text" id="audience_tel1" size="4" value="86" />
		      -
		      <input name="audience_tel2" type="text" id="audience_tel2" size="4" />
		      -
		      <input name="audience_tel3" type="text" id="audience_tel3" size="15" />
		      <!-- 将电话拼接 -->
		      <input type="hidden" name="audience.audience_tel" id="audience_tel" value="77666666"/>
			</td>
		</tr>
		<tr >
			<td align="right"  bgcolor="#FFFFFF" style="fontblack">
				传真：<img alt="" src="images/required.gif" align="top"/>
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack" valign="center">
				<!-- <input type="text" id="audience_fax1" name="audience_fax1" class="textcss"  style="width:200px"/> -->
			  <input name="audience_fax1" type="text" id="audience_fax1" size="4" value="86" />
		      -
		      <input name="audience_fax2" type="text" id="audience_fax2" size="4" />
		      -
		      <input name="audience_fax3" type="text" id="audience_fax3" size="15" />
		      <input type="hidden" id="audience_fax" name="audience.audience_fax" value="77666666"/>
			</td>
		</tr>
		<tr >
			<td align="right"  bgcolor="#FFFFFF" style="fontblack">
				手机：<img alt="" src="images/required.gif" align="top"/>
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
				<input type="text" id="audience_mobile" name="audience.audience_mobile" value="<s:property value="#session.audience_mobile"/>" class="textcss" style="width:200px"/>
			</td>
		</tr>
		<tr>
			<td align="right"  bgcolor="#FFFFFF" style="fontblack">
				电子邮件：<img alt="" src="images/required.gif" align="top"/>
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
			<input type="text" id="audience_Email" name="audience.audience_Email" value="<s:property value="#session.audience_email"/>" class="textcss" style="width:200px"/>
			<div>请务必填写您经常使用的有效信箱，以便我们发送“预先登记确认函”给您</div>
			</td>
		</tr>
		<tr >
			<td align="right"  bgcolor="#FFFFFF" style="fontblack">
				电子邮件（确认）：<img alt="" src="images/required.gif" align="top"/>
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
				<input type="text" id="audience_reEmail" name="audience_reEmail" class="textcss" style="width:200px"/>
			</td>
		</tr>
		<tr >
			<td align="right"  bgcolor="#FFFFFF" style="fontblack">
				网址：&nbsp;<!-- <img alt="" src="images/required.gif" align="top"/> -->
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
				<input type="text" id="audience_weburl" name="audience.audience_weburl" class="textcss" style="width:300px">
			</td>
		</tr>
		<tr>
			<td colspan="2" align="left" bgcolor="#FFFFCC" style="fontblack" height="40px">
				请填写问卷调查<img alt="" src="images/required.gif" align="top"/>
				<input type="hidden" name="questioninfo" id="questioninfo"/><!-- 问卷调查的信息 -->
			</td>
		</tr>
		
		<s:iterator value="#request.qTitleList" id="qTitle" status="titsataus">
  		<tr>
			<td  align="left"  bgcolor="#FFFFFF" style="fontblack">
			<s:property value="#titsataus.index+1"/>，<s:property value="#qTitle.Qtitle"/>
			<s:if test="#qTitle.isCheckBox == 1">
			（可复选划√）
			</s:if>
			<s:elseif test="#qTitle.isCheckBox == 0">
			（可单选）
			</s:elseif>
			</td>
			<td align="left"  bgcolor="#FFFFFF" style="fontblack">
			<input type="hidden" id="qtitle<s:property value="#titsataus.index"/>" value="<s:property value="#qTitle.id"/>"/><!-- 第组大类的id -->
				<table border = "0">
						<tr>
						<td>
							<table>
							<s:iterator value="%{#qTitle.audienceQs}" id="audienceq" status="status">
							<tr>
							<td width="375px">
								<s:if test="#audienceq.isAvalible==1&&#status.index%2==0">
								<s:if test="#qTitle.isCheckBox == 1">
									<input type="checkbox" name="<s:property value="#qTitle.id"/>" value="<s:property value="#audienceq.id"/>" />
								</s:if>
								<s:elseif test="#qTitle.isCheckBox == 0">
									<input type="radio" value="<s:property value="#audienceq.id"/>" name="<s:property value="#qTitle.id"/>"/>
								</s:elseif>
								<!-- <s:property value="#status.index"/>
								<s:property value="#audienceq.id"/> --> 
	  							<s:property value="%{#audienceq.Qtext}"/>  
	  							</s:if>
							</td>
							</tr>
	  						</s:iterator>
	  						<tr>
	  							<td>
	  							<s:if test="#qTitle.isCheckBox == 1">
									<input type="checkbox" style="margin-bottom: 0px;" name="<s:property value="#qTitle.id"/>" value="-1" />
								</s:if>
								<s:elseif test="#qTitle.isCheckBox == 0">
									<input type="radio" name="<s:property value="#qTitle.id"/>" value="-1"/>
								</s:elseif>
	  								<!-- <input type="radio" name="#qTitle.id" value="-1"/> -->其他，请说明
	  								<input type="text" id="<s:property value="#qTitle.id"/>" name="<s:property value="#qTitle.id"/>"/>
	  								<br/>
	  								<span id="span_<s:property value="#qTitle.id"/>"></span>
	  							</td>
	  						</tr>
							</table>
						</td>
						<td valign="top">
							<table border="0">
							<s:iterator value="%{#qTitle.audienceQs}" id="audienceq" status="status">
							<tr>
							<td>
								<s:if test="#audienceq.isAvalible==1&&#status.index%2!=0">
								<s:if test="#qTitle.isCheckBox == 1">
									<input type="checkbox" value="<s:property value="#audienceq.id"/>" name="<s:property value="#qTitle.id"/>">
								</s:if>
								<s:elseif test="#qTitle.isCheckBox == 0">
									<input type="radio" value="<s:property value="#audienceq.id"/>" name="<s:property value="#qTitle.id"/>"/>
								</s:elseif>
								<!-- <s:property value="#status.index"/>
								<s:property value="#qTitle.id"/> --> 
	  							<s:property value="%{#audienceq.Qtext}"/>
	  							</s:if>
							</td>
							</tr>
							</s:iterator>
							</table>
						</td>
						</tr>
				</table>
			</td>
  		</tr>
  		</s:iterator>
  		<tr>
			<td colspan="2" align="left" bgcolor="#FFFFCC" style="fontblack" height="40px">
				推荐我的朋友<br/>
				我希望邀请我的 
				<select name="EmailCount" id="EmailCount" style="width:50px" onchange="checkEmails(this.options[this.selectedIndex].value)">
			        <option value="1">1</option>
			        <option value="2">2</option>
			        <option value="3">3</option>
			        <option value="4">4</option>
			        <option value="5">5</option>
		      	</select>
				 位朋友参加展览会。 
				<!-- <img alt="" src="images/required.gif" align="top"/>
				<input class="submitcss" type="submit" value="下一步>>" style="width: 200px;border: 0px;height: 20px" onclick="return validate()"/> -->
			</td>
		</tr>
		<tr>
      		<td bgcolor="#FFFFFF" style="fontblack">对方E-Mail地址</td>
      		<td bgcolor="#FFFFFF" id="Emails"><input type="text" name="ToEmail1" id="ToEmail1" /><input type="hidden" name="emails" id="emails" value=""/></td>
   		</tr>
    	<tr bgcolor="#FFFFFF">
    	<td colspan="2" align="center">
    	<input name="version" type="hidden" id="version" value="Chinese" />
    	<input name="button" type="submit" id="btnSubmit"  value=" 确认无误，提交信息 " class="MyButton"  style="width:200px"/>
    	</td>
    	</tr>
   </table>
   </form>
   <iframe src="${pageContext.request.contextPath}/preAudienceAction!toIndexPage.action?source=${showInfo.urlChannel}&pageName=footer" marginheight="0" marginwidth="0" frameborder="0" scrolling="no" width="100%" height="50"></iframe>
   </center>

  </body>
</html>
